# if else判断
# age = int(input("请输入年龄："))
# if age >= 18:
#     print("允许进入网吧")
# else:
#     print("未成年禁止进入")

# and or not 逻辑运算条件
# age = 19
# if 0 < age < 120:
#     print("年龄正确")

# 输入用户年龄
# age = int(input("请输入用户年龄："))
# # 判断年龄：条件是否18
# if age >= 18:
# # 满足条件
#     print("允许进网吧happy~")
# else:
# # 不满足条件
#     print("回家写作业吧~")

# 逻辑运算
# pytthon_score = 80
# c_score = 30
# if pytthon_score > 60 or c_score > 60:
#     print("成绩合格")

# employer = False
# if not (employer is False):
#     print("公司员工")
# else:
#     print("不是公司员工")

# # 定义分数变量
# score = int(input("请输入分数："))
# # 判断分数
# if score >= 90:
#     print("优秀")
# elif 80 <= score < 90:
#     print("良好")
# elif 70 <= score <80:
#     print("中等")
# elif 60 <= score < 70:
#     print("差")
# else:
#     print("不及格")

# if嵌套
# has_ticket = input("请确认是否有票：")
# if has_ticket:
#     knife_length = int(input("请输入刀的长度："))
#     if knife_length >= 20:
#         print("不允许上车")
#     else:
#         print("安检通过，允许上车")
# else:
#     print("不允许进门")

# 综合案例
# import random
# num = random.randint(10,20)
# print(num)

# 石头剪刀布游戏
# import random
# player = int(input("请输入出拳数字（1/2/3）："))
# computer = random.randint(1,3)
# # 出拳判断条件
# if (player == 1 and computer == 2) or (player == 2 and computer == 3) or (player == 3 and
# computer == 1):
#     print("电脑你太菜了，哈哈哈~")
# # 条件2：打平了
# elif player == computer:
#     print("打平了，咱俩心有灵犀")
# # 条件3：人输了
# else:
#     print("电脑你太厉害了~")

# 循环结构
# while循环
# 1.定义计数器
# num = 1
# 2.设置循环条件(不够100次需要重复执行)
# while num <= 10:
# 3.执行循环代码
#     print("媳妇,对不起我错了!")
# 4.修改计数器
# num += 1

# 1.定义计数器
# num = 1
# # 定义初始结果变量
# result = 0
# # 2.设置while循环条件
# while num <= 100:
# # 3.编写循环代码
#     result = result + num
# # 4.修改计数器
#     num += 1
# # 查看计算结果
# print(f"求和的结果为：{result}")

# 案例 吃苹果
# 1.定义计数器
# num = 1
# # 2.设置while循环
# while num <= 5:
#     print(f"吃了第{num}个苹果")
# # 判断是否吃饱？ num数量是否是3
#     if num == 3:
#         print("吃饱了，后面的不吃了")
#         break
# # 4.修改计数器
#     num += 1

# for循坏
# 1.定义字符串变量
# info = "itheima"
# for i in info:
#     if i == "e":
#         break
#     print(i)

# for i in range(10):
#     print("媳妇,对不起我错了!")
# result = 0
# for i in range(0, 101, 2):
#     result += i
# print(result)
# # 方式2
# result = 0
# for i in range(101):
# # 先取出i，然后在判断
#     if i % 2 == 0:
#         result += i
#     print(result)

# 课堂案例--模拟破解系统密码
# 1.定义计数器(次数)
num = 1
while True:
    username = input("请输入用户名：")
    if username == "exit":
        break
    password = input("请输入密码：")
# 判断账号密码
    if username == "admin" and password == "123456":
        print("登录成功！")
        break
    else:
        print("用户名或密码错误！")
    pass





